from django.contrib import admin
from import_export.admin import ImportExportModelAdmin

# Register your models here.
from .models import Question, Choice

#admin.site.register(Question)
#admin.site.register(Choice)
class  ChoiceInline(admin.TabularInline):
	model = Choice
	extra = 1

@admin.register(Question)
class QuestionAdmin(ImportExportModelAdmin):
	fieldsets = [
	(None, {'fields':['question_text','shenfenzhenghao','tags']}),
	('Date information', {'fields': ['pub_date'], 'classes':['collapse']}),
		]
#	inlines = [ChoiceInline]
	list_display = ('question_text', 'pub_date', 'was_published_recently','tags')
	list_filter = ['pub_date',]
	search_fields = ['question_text',]

@admin.register(Choice)
class ChoiceAdmin(ImportExportModelAdmin):
	pass
'''
from import_export import resources
class QuestionAdmin(resources.ModelResource):
    class Meta:
        model = Question
'''

#admin.site.register(Question, QuestionAdmin)

